/**
 * 把时间戳转换成年月日时分秒
 */
export function formatMillisecondsToDateTime(milliseconds) {
	const date = new Date(milliseconds);
	const year = date.getFullYear();
	const month = String(date.getMonth() + 1).padStart(2, '0');
	const day = String(date.getDate()).padStart(2, '0');
	const hours = String(date.getHours()).padStart(2, '0');
	const minutes = String(date.getMinutes()).padStart(2, '0');
	const seconds = String(date.getSeconds()).padStart(2, '0');
	return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}

// 异步获取存储的用户信息
export function getUserinfo() {
	
	// uni.getStorage({
	// 	key: 'login-userinfo',
	// 	success: function(res) {
	// 		console.log('获取用户信息成功', res.data);
	// 		userinfo = res.data;
	// 	},
	// 	fail: function() {
	// 		console.log('未找到用户信息');
	// 	},
	// 	complete: function() {
	// 		console.log('获取操作完成');
	// 	}
	// });
	let userinfo = uni.getStorageSync('login-userinfo')
	return userinfo;
}